#pragma once
#include <vector>
#include <functional>
#include "../Headers/types.h"
#include "gui.window.h"

namespace TOB {
  class UIText: public UIWindow {
   public:
    UIText(uint16 x, uint16 y, uint16 w, uint16 h);
    ~UIText();
    
    void focus();

    void insert(Char in);
    void remove();
    void removeNext();
    void split();
    void join();

    void moveX(int8 direction);
    void moveY(int8 direction);

    void printLine();
    void printBlock();

    bool running;
    std::vector<String> lines;
    bool multiline, password;
    std::function<void()> eventTab, eventReturn;

    uint16 x, y;
    uint32 scrollX, scrollY;

   protected:
    uint32 actX, actY;
    String allowedSymbols;
  };
}
